<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>JSON & PHP</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
</head>
<script type="text/javascript" src="jquery.js"></script>
<body>
<form action="test.php">

<input type="text" id="user" />

<input type="submit" id="submit" />

</form >
<div id="box" ></div >


<script type="text/javascript">
$(document).ready(function (){

$('#submit').click(function (){

var temp = $('#user').val();

$.get('test.php',{'query':temp},function (data){

$('#box').append(data);

});

return false;
});
});
</script>
</body>
</html>

